useFixture(default)

def test():
	from Modules import commonBits
	java_recorded_version = '1.5.0_11'

	if window('Protocol Buffer Editor'):
		select('FileChooser', commonBits.sampleDir() + 'protoSales.bin')
		click('Edit1')
		select_menu('View>>Sorted Field Tree')
		##select('List', 'sale')
		select('Table', 'store', 'Field,0')
		select('Table', 'department', 'Field,1')
		select('Table', 'cell:Field,1(department)')
		click('Build Tree')
		select('JTreeTable', 'cell:keycode,1(null)')
		rightclick('JTreeTable', 'store,1')
		select_menu('Copy Record#{s#}')
		select('JTreeTable', 'cell:store,3(null)')
		rightclick('JTreeTable', 'store,3')
		select_menu('Paste Record#{s#}')
		select('JTreeTable', 'cell:store,3(null)')
		#click('ToolTip', 3, 11)
		select('JTreeTable', 'cell:store,4(null)')
		rightclick('JTreeTable', 'store,4')
		select_menu('Expand Tree')
		select('JTreeTable', 'cell:Tree,3(null)')
		rightclick('JTreeTable', 'Tree,3')
		select_menu('Expand Tree')
		select('JTreeTable', 'cell:keycode,3(null)')
		rightclick('JTreeTable', 'keycode,3')
		select_menu('Collapse Tree')
		select('JTreeTable', 'rows:[5,6],columns:[Tree]')
		select_menu('View>>Table View #{Selected Records#}')
		select('JTreeTable', 'rows:[5,6],columns:[Tree]')
		select('Table', 'cell:1|keycode,0(61664713)')
		assert_p('Table', 'Text', '59', '2|store,1')
		select('Table', 'cell:1|keycode,1(61664713)')
		assert_p('Table', 'Content', '[[61664713, 59, 335, 40118, 1, 17990], [61664713, 59, 335, 40118, -1, -17990], [61684613, 59, 335, 40118, 1, 12990], [68634752, 59, 410, 40118, 1, 8990]]')
		select('Table', 'cell:1|keycode,2(61684613)')
		assert_p('Table', 'RowCount', '4')
		select('Table', 'cell:1|keycode,2(61684613)')
		click('BasicInternalFrameTitlePane$NoFocusButton2')
		select('JTreeTable', 'rows:[3,4,5],columns:[Tree]')
		select_menu('View>>Table View #{Selected Records#}')
		select('JTreeTable', 'rows:[3,4,5],columns:[Tree]')
		select('Table', 'cell:2|store,4(184)')
		assert_p('Table', 'RowCount', '210')
		select('Table', 'cell:2|store,4(184)')
		click('BasicInternalFrameTitlePane$NoFocusButton2')
		select('JTreeTable', 'cell:Tree,1(null)')
		rightclick('JTreeTable', 'Tree,1')
		select_menu('Copy Record#{s#}')
		select('JTreeTable', 'cell:Tree,0(null)')
		rightclick('JTreeTable', 'Tree,0')
		select_menu('Paste Record#{s#} Prior')
		select('JTreeTable', 'cell:Tree,1(null)')
		assert_p('JTreeTable', 'RowCount', '6')
		select('JTreeTable', 'cell:Tree,0(null)')
		rightclick('JTreeTable', 'Tree,0')
		select_menu('Expand Tree')
		select('JTreeTable', 'cell:keycode,7(null)')
		rightclick('JTreeTable', 'keycode,7')
		select_menu('Expand Tree')
		select('JTreeTable', 'cell:keycode,5(null)')
		assert_p('JTreeTable', 'RowCount', '17')
		select('JTreeTable', 'rows:[6,7,8],columns:[keycode]')
		select_menu('View>>Table View #{Selected Records#}')
		select('JTreeTable', 'rows:[6,7,8],columns:[keycode]')
		select('Table', 'cell:2|store,2(59)')
		assert_p('Table', 'Content', '[[64614401, 59, 957, 40118, 1, 1990], [64614401, 59, 957, 40118, 1, 1990], [62684217, 59, 957, 40118, 1, 9990], [64624770, 59, 957, 40118, 1, 2590], [63604808, 20, 170, 40118, 1, 4870]]')
		select('Table', 'cell:1|keycode,3(64624770)')
		assert_p('Table', 'Text', '64624770', '1|keycode,3')
		select('Table', 'cell:1|keycode,1(64614401)')
		assert_p('Table', 'RowCount', '5')
		select('Table', 'cell:1|keycode,1(64614401)')
		click('BasicInternalFrameTitlePane$NoFocusButton2')
		click('BasicInternalFrameTitlePane$NoFocusButton2')
		click('BasicInternalFrameTitlePane$NoFocusButton2')

		if window('Save Changes to file: ' + commonBits.sampleDir() + 'protoSales.bin'):
			click('No')
		close()
	close()
